<template>
  <div>
    <fwb ref="fwb" v-model="content"></fwb>
    <button @click="getInfo">获取富文本里面的内容</button>
    <button @click="edit">对富文本进行赋值</button>
  </div>
</template>

<script>
import fwb from "@/components/Tinymce/index.vue";
export default {
  components: {
    fwb
  },
  data() {
    return {
      content: "",
      htmls: "<h2 style='color:red'>不凡学员</h2>"
    };
  },
  computed: {},
  created() {},
  mounted() {},
  methods: {
    edit() {
      // 对富文本编辑器进行赋值
      //this.content = this.html+new Date(); // v-model 对富文本进行赋值只在第一次起作用
      this.$refs.fwb.setContent(this.htmls + new Date());
    },
    getInfo() {
      // 获取富文本内容的两种方式
      console.log(this.content);
    }
  }
};
</script>

<style scoped lang="scss">
</style>
